package com.day09;



/**
 * 多态性的使用举例一:
 */
public class AnimalTest {


    public static void main(String[] args) {
        new AnimalTest().func(new Dog());
    }


    public void func(Animal animal){
        animal.eat();
        animal.shout();
    }

}


class Dog extends Animal {
    public void eat() {
        System.out.println("猫吃鱼");
    }

    public void shout() {
        System.out.println ("动物,叫");
    }
}
